<script lang="ts" setup>
import { computed, unref } from 'vue'
import { LoginStateEnum, useLoginState } from './useLogin'

const { getLoginState } = useLoginState()

const getFormTitle = computed(() => {
  const titleObj = {
    [LoginStateEnum.RESET_PASSWORD]: '重置密码',
    [LoginStateEnum.LOGIN]: '登录',
    [LoginStateEnum.REGISTER]: '注册',
    [LoginStateEnum.MOBILE]: '手机登录',
  }
  return titleObj[unref(getLoginState)]
})
</script>

<template>
  <h2 class="enter-x mb-3 text-center text-2xl font-bold xl:text-left xl:text-3xl">
    {{ getFormTitle }}
  </h2>
</template>
